package com.test.controller;

import com.test.entity.Book;
import com.test.service.BookServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/book")
public class BookController {
    @Autowired
    private BookServiceImpl bookService;
    @RequestMapping("/{bid}")
    public Book getBookById(@PathVariable("bid") int id) {
        Book book = bookService.getById(id);
        return book;
    }

}
